import { createStore } from 'vuex'
import createPersistedState from "vuex-persistedstate";

export default createStore({

  plugins: [
    createPersistedState({ storage: window.localStorage }) //配置为sessionStorage，如果不传入对象就是默认
  ],
  state: {
    baseurl: "http://127.0.0.1:8888/",
    userdata: null,
  },
  mutations: {
    setuserdata(state, val) {
      state.userdata = val
    }
  },
  actions: {
  },
  modules: {
  }
})
